import request from './request'

export const menuApi = {
  // 获取菜单树
  getMenuTree() {
    return request.get('/system/menu/tree')
  },
  
  // 获取用户菜单
  getUserMenus(userId) {
    return request.get(`/system/menu/user/${userId}`)
  },
  
  // 创建菜单
  createMenu(data) {
    return request.post('/system/menu', data)
  },
  
  // 更新菜单
  updateMenu(data) {
    return request.put('/system/menu', data)
  },
  
  // 删除菜单
  deleteMenu(id) {
    return request.delete(`/system/menu/${id}`)
  }
}